home *** CD-ROM | disk | FTP | other *** search
/ Windows Expert / Windows Expert.iso / windownt / greps.zip / README~1.CRA < prev    next >
Text File  |  1993-09-17  |  3KB  |  85 lines

  1. (Message inbox:135)
  2. Date:    Mon, 17 Oct 88 16:53:33 PDT
  3. To:      mike@wheaties.ai.mit.edu
  4. cc:      darin%pioneer@eos.arc.nasa.gov, luzmoor@violet.berkeley.edu
  5. From:    James A. Woods <jaw@eos.arc.nasa.gov>
  6. Subject: README.cray for GNU e?grep
  7.  
  8. I just sent this out to comp.unix.cray:
  9.  
  10. -------------------------------------------------------------------
  11. From: jaw@eos.UUCP (James A. Woods)
  12. Newsgroups: comp.unix.cray
  13. Subject: GNU e?grep on Cray machines
  14. Message-ID: <1750@eos.UUCP>
  15. Date: 17 Oct 88 23:47:29 GMT
  16. Organization: NASA Ames Research Center, California
  17. Lines: 66
  18.  
  19. # "What comes after silicon?  Oh, gallium arsenide, I'd guess.  And after 
  20.    that, there's a thing called indium phosphide."
  21.     -- Seymour Cray, Datamation interview, circa 1980
  22.  
  23.      Now that most Cray software development is done on Crays themselves, 
  24. thanks to Unix, GNU e?grep should come in handy.  Of course, if you're
  25. scanning GENBANK for the Human Genome Project at 10 MB/second (the raw
  26. X/MP Unix I/O rate), you really do need the speed.
  27.  
  28.      Sample, from one of the Ames Cray 2 machines:
  29.  
  30.     stokes> time ./egrep astrian web2        # GNU egrep
  31.     alabastrian
  32.     Lancastrian
  33.     Zoroastrian
  34.     Zoroastrianism
  35.     0.5980u 0.0772s 0:01 35%
  36.     stokes> time /usr/bin/egrep astrian web2    # ATT egrep
  37.     alabastrian
  38.     Lancastrian
  39.     Zoroastrian
  40.     Zoroastrianism
  41.     7.6765u 0.1373s 0:15 49%
  42.  
  43. (web2 is a 2.4 MB wordlist, standard on BSD Unix.)
  44.  
  45.      To bring up GNU E?GREP, ftp Mike Haertel's version 1.1 package from
  46. 'prep.ai.mit.edu' or 'ames.arc.nasa.gov'.  Mention -DUSG in the Makefile,
  47. and specify 
  48.  
  49.     #define SIGN_EXTEND_CHAR(c) ((c)>(char)127?(c)-256:(c))
  50.  
  51. in regex.c. [Cray characters, like MIPS chars, are unsigned, but the
  52. compiler won't allow ... #define SIGN_EXTEND_CHAR(c) ((signed char) (c))]
  53.     
  54.      However, at least on the Cray 2, there's a compiler bug involving the
  55. increment operator in complex expressions, which requires the following
  56. modification (also in regex.c):
  57.  
  58. change
  59.         m->elems[m->nelem++].constraint |= s2->elems[j++].constraint;
  60. to
  61.         m->elems[m->nelem].constraint |= s2->elems[j].constraint;
  62.         m->nelem++;
  63.         j++;
  64.  
  65. Thanks go to Darin Okuyama of NASA ARC for providing this workaround.
  66.  
  67. -- James A. Woods (ames!jaw)
  68.    NASA Ames Research Center
  69.  
  70. P.S.  
  71. Though Crays are not at their best pushing bytes, the timing difference
  72. is even more exaggerated with heavier regexpr processing, to wit:
  73.  
  74.     time ./egrep -i 'as.*Trian' web2
  75.     ...
  76.     0.7677u 0.0769s 0:01 44%
  77. vs.
  78.     time /usr/bin/egrep -i 'as.*Trian' web2
  79.     ...
  80.     16.1327u 0.1379s 0:32 49%
  81.  
  82. which is a mite unfair given a known System 5 egrep -i gaffe.  You get
  83. extra credit for vectorizing the inner loop of the Boyer/Moore/Gosper
  84. code, though changing all chars to ints might help also.
  85.